﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SongSharp.Domain.Data;
using SongSharp.Domain.Objects;

namespace SongSharp.Appliance
{
    public static class SongSharpApp
    {
        private static SongSharpState m_states;
        public static SongSharpState States
        {
            get
            {
                return m_states;
            }
            set
            {
                m_states = value;
            }
        }  

        public static void Start(string databasePath)
        {
            DataManager.CreateInstance(databasePath);
        }

        public static void InitState()
        {
            m_states = SongSharpState.Get();

            if (m_states == null)
                m_states = new SongSharpState();
        }

        public static void OnClose(object sender, EventArgs e)
        {
            SongSharpState.Update(SongSharpApp.States);
        }
    }
}
